/*
 * @Author: DUST
 * @Date: 2023-05-26 16:03:52
 * @LastEditors: DUST
 * @LastEditTime: 2023-05-28 11:21:22
 * @FilePath: \koa-node-ts\app\service\UserService.ts
 * @Description: 
 * undefined
 */

import User from "../model/User";

class UserService {
  getAdmin() {
    return User.findOne();
  }
  getAdminById(id: number) {
    return User.findByPk(id);
  }
  getAdminListByPage(pageNumber: number = 1, pageSize: number = 10) {
    return User.findAndCountAll({
      limit: pageSize,
      offset: (pageNumber - 1) * pageSize
    })
  }
}

export default new UserService;